Skip to content

Send original generated images as files#360

Merged
ModerRAS merged 1 commit into
masterfrom
codex/send-original-generated-images
May 31, 2026
Merged

Send original generated images as files#360
ModerRAS merged 1 commit into
masterfrom
codex/send-original-generated-images

Conversation

@ModerRAS
Copy link
Copy Markdown
Owner

@ModerRAS ModerRAS commented May 31, 2026

Summary

  • send generated image photo previews and original image files by default
  • add sendOriginalFile tool option and return original file send results
  • document the generated-image send behavior

Tests

  • dotnet build TelegramSearchBot.sln --configuration Release
  • dotnet test TelegramSearchBot.sln --configuration Release --no-build

Summary by CodeRabbit

  • New Features

    • Image generation tool now supports sending original images as Telegram documents alongside photo previews.
  • Documentation

    • Expanded documentation for the image generation tool, including details about model selection, API endpoints, configuration via LLM channels, and updated default output behavior.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 31, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a4ddf8eb-2be6-486f-96ce-dfce6f90acd8

📥 Commits

Reviewing files that changed from the base of the PR and between 24c9b98 and 0e25cd6.

📒 Files selected for processing (5)
  • Docs/Bot_Commands_User_Guide.md
  • Docs/README_MCP.md
  • README.md
  • TelegramSearchBot.Common/Model/Tools/ImageGenerationResult.cs
  • TelegramSearchBot/Service/Tools/ImageGenerationToolService.cs

📝 Walkthrough

Walkthrough

This PR extends image generation to send original files as Telegram documents alongside photo previews. The feature adds a sendOriginalFile parameter to control document upload, updates the result type to track document sends, refactors upload logic into separate methods, and documents the behavior across user guides and technical references.

Changes

Image Generation Document File Support

Layer / File(s) Summary
Data model for document upload tracking
TelegramSearchBot.Common/Model/Tools/ImageGenerationResult.cs
ImageGenerationResult includes new SentOriginalFiles property tracking Telegram document send results.
GenerateImage service implementation
TelegramSearchBot/Service/Tools/ImageGenerationToolService.cs
Service method accepts sendOriginalFile parameter (default true), uses environment-dependent document size limits, refactors upload into SendPhotoPreview and SendDocumentUpload methods, tracks photo and document results separately in chat-send loop, and aggregates success/error across both upload types.
User and technical documentation
README.md, Docs/README_MCP.md, Docs/Bot_Commands_User_Guide.md
Documentation updated to describe model selection, OpenAI-compatible and MiniMax API endpoints, configurable API address via LLM channel, default preview and original-file sending behavior, and sendOriginalFile parameter in tool definition.

Sequence Diagram

sequenceDiagram
  participant GenerateImage
  participant SendPhotoPreview
  participant SendDocumentUpload
  participant TelegramAPI
  GenerateImage->>SendPhotoPreview: send preview image
  SendPhotoPreview->>TelegramAPI: POST photo
  TelegramAPI-->>SendPhotoPreview: photo result
  SendPhotoPreview-->>GenerateImage: photo send result
  alt sendOriginalFile enabled
    GenerateImage->>SendDocumentUpload: send original file
    SendDocumentUpload->>TelegramAPI: POST document (size-checked)
    TelegramAPI-->>SendDocumentUpload: document result
    SendDocumentUpload-->>GenerateImage: document send result
  end
  GenerateImage->>GenerateImage: aggregate photo + document results
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 A picture's worth a thousand words, they say,
Now documents and photos save the day!
Through Telegram we send them both with cheer,
Preview here, and original file there! 📸

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Send original generated images as files' accurately describes the main change: adding functionality to send generated images as document files in addition to photo previews.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/send-original-generated-images

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown
Contributor

PR Check Report

Summary

Test Results

Platform Status Details
Ubuntu Passed Tests passed, artifacts uploaded
Windows Passed Tests passed, artifacts uploaded

Code Quality

  • Code formatting check
  • Security vulnerability scan
  • Dependency analysis
  • Code coverage collection

Test Artifacts

  • Test results artifacts count: 2
  • Code coverage uploaded to Codecov

Links


This report is auto-generated by GitHub Actions

@ModerRAS ModerRAS merged commit 0023b10 into master May 31, 2026
5 checks passed
@ModerRAS ModerRAS deleted the codex/send-original-generated-images branch May 31, 2026 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant